layui.use(['element','layer','form','table'], function() {
	var element = layui.element;
	var layer = layui.layer;
	var form = layui.form;
	var table = layui.table;
	
 	// 获取快递公司下拉框数据
	 $.ajax({
		url: '/account/query/express/company',
		type: 'post',
		dataType: 'json',
		success: function(data){
			var html = '<option value="">请选择</option>';
			var expressCodeInput = $('input[name="expressCodeInput"]').val();
			$.each(data, function(i,item){
				if(item.expressCode == expressCodeInput){
					html += '<option value="' + item.expressCode + '" selected>' + item.expressName + '</option>';
				} else {
					html += '<option value="' + item.expressCode + '">' + item.expressName + '</option>';
				}
			});
			
			$('#expressCode').empty();
			$('#expressCode').append(html);
			 // 渲染下拉框
			form.render();
		}
	});
	
	$('#edit').click(function(){
		$('.edit-account').css('display','block');
	})
	
});

// 动态获取支出表格信息
function selectDayBook(){
	var dayBook = {};
	var payCode = $('#payCode').val();
	$.ajax({
		url: '/account/query/daybook?payCode=' + payCode,
		type: 'post',
		dataType: 'json',
		success: function(data){
			dayBook = data;
		}
	});
	
	return dayBook;
}

//删除
function del(index){
	//a >    td   >    tr
	var result = 0;
	var isActive = $('#isActive'+index).val(result);
	$('#pkid'+index).parent().parents('tr').remove();
}